;
(function () {

  'use strict';

  angular.module('controllers.customActivity')
    .controller('summaryActivityEditCtrl', summaryActivityEditCtrl);

  function summaryActivityEditCtrl($scope, pageConfigService, $state, summaryService) {

    $scope.page = pageConfigService;

    $scope.cancel = function (ev) {
      if (confirm('您确定要关闭预览页面？关闭后数据将不保存')) {
        summaryService.showDialog(ev, pageConfigService.pageInfo.summaryId, true);
        $state.go('sas.summary');
      }
    };

    $scope.ok = function (ev) {
      pageConfigService.pageInfo.layout = pageConfigService.e.getResultDom();//保存调整后的dom结构
      summaryService.showDialog(ev, pageConfigService.pageInfo.summaryId, true);
      $state.go('sas.summary');
    };
  }

  summaryActivityEditCtrl.$inject = ['$scope', 'pageConfigService', '$state', 'summaryService'];
})();